package com.cyt.reward.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 打赏功能-员工管理实体类
 *
 * @author rong yuan
 * @date 2019-7-24 14:21:33
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_reward_staff")
public class RewardStaff implements Serializable {

    /**
     * 主键ID
     */
    @Id
    private String id;

    /**
     * 应用ID
     */
    @Column(name = "apply_id")
    private String applyId;

    /**
     * 会员ID
     */
    @Column(name = "member_id")
    private String memberId;

    /**
     * 工号
     */
    @Excel(name = "工号")
    @Column(name = "job_num")
    private String jobNum;

    /**
     * 真实姓名
     */
    @Excel(name = "姓名")
    @Column(name = "name")
    private String name;

    /**
     * 手机号码
     */
    @Excel(name = "手机号码")
    @Column(name = "mobile")
    private String mobile;

    /**
     * 密码
     */
    @Excel(name = "初始密码")
    @Column(name = "password")
    private String password;

    /**
     * 评价星级
     */
    @Column(name = "stars")
    private Double stars;

    /**
     * 所有赏金
     */
    @Column(name = "total_money")
    private Double totalMoney;

    /**
     * 剩余赏金
     */
    @Column(name = "have_money")
    private Double haveMoney;

    /**
     * 收款账号
     */
    @Excel(name = "收款账号")
    @Column(name = "account")
    private String account;

    /**
     * 员工类型：1-管理员；2-普通员工
     */
    @Excel(name = "员工类型", replace = {"管理员_1", "普通员工_2"})
    @Column(name = "staff_type")
    private String staffType;

    /**
     * 是否删除：1-未删除；2-已删除
     */
    @Column(name = "remove_tag")
    private String removeTag;

    /**
     * 创建人
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新人
     */
    @Column(name = "update_user")
    private String updateUser;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 创建对象
     *
     * @param sysUser 当前用户信息
     * @author rong yuan
     * @date 2019-7-24 14:21:33
     */
    public RewardStaff(SysUser sysUser) {
        this.id = BaseUtil.uId();
        this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.createUser = sysUser.getId();
        this.updateTime = new Date();
        this.updateUser = sysUser.getId();
    }
}